package com.ma;

import com.ma.service.MyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringAspectj01Application {
    private static final Logger log = LoggerFactory.getLogger(SpringAspectj01Application.class);

    public static void main(String[] args) {
        //ConfigurableApplicationContext context = SpringApplication.run(SpringAspectj01Application.class, args);
        //MyService service = context.getBean(MyService.class);
        //
        //log.debug("service class: {}", service.getClass());
        //service.foo();
        //
        //context.close();
        new MyService().foo();
        /*
        Aspect 不是Spring的  编译时增强class文件 给父类加方法  使用maven aspect插件编译
        观察反编译后的类
        public void foo() {
            MyAspect.aspectOf().before();
            log.debug("foo()");
        }
        这种方式静态方法也可以增强！  直接修改class源码
         */
    }

}
